import {GussBigQuestionGenner, GussNumQuestionGenner} from "./control/question_genner";
import {GussBigChecker, GussNumChecker} from "./control/checker";
import { IQuestion } from "./model/question";


function test001(){
  const gussbug =new GussBigQuestionGenner()
  for(let i = 0; i < 100; i++){
    console.log(gussbug.gen())
  }
  console.log("-----------------------------------------")
  const gussnum =new GussNumQuestionGenner()
  for(let i = 0; i < 100; i++){
    console.log(gussnum.gen())
  }

}

function test002(){
  const gussbug =new GussBigQuestionGenner()
  const q = gussbug.gen()
  const qNum = Number(q.question)
  const checker =new GussBigChecker()
  console.log(  checker.check({
    answer: String(qNum)
  },q))

  console.log(  checker.check({
    answer: String(qNum+2)
  },q))


  console.log(  checker.check({
    answer: String(qNum-2)
  },q))

}


function test003(){
  const q: IQuestion = {
    question: "2431"
  }
  const qNum = Number(q.question)
  const checker =new GussNumChecker()
  console.log(  checker.check({
    answer: "1234"
  },q))

  console.log(  checker.check({
    answer: "2134"
  },q))


  console.log(  checker.check({
    answer: "7890"
  },q))

  console.log(  checker.check({
    answer: "2431"
  },q))

}


test003()